package com.ipbd.constant;

/**
 * @author xh
 * @Date 2024/2/19
 */
public enum QuestionnaireConstant {
    GAD(1, "GAD-7"),
    AIS(2, "AIS"),
    PSQI(3, "PSQI"),
    FACT(4, "FACT-G"),
    RES(5, "RES"),
    SDS(6, "SDS");


    private Integer num;
    private String name;

    QuestionnaireConstant(Integer num, String name) {
        this.num = num;
        this.name = name;
    }

    public Integer getNum() {
        return num;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据问卷类型获取问卷名称
     */
    public static String name(int num) {
        for (QuestionnaireConstant c : QuestionnaireConstant.values()) {
            if (c.getNum() == num) {
                return c.getName();
            }
        }
        return null;
    }


}
